1. Field of the Invention
Embodiments of this invention relate generally to computers, and, more particularly, to a method and apparatus for controlling the fetching operations of a processor to conserve power.
2. Description of Related Art
To improve computational throughput, a processor may have a pipeline and one or more speculation units that provide instructions speculatively to the pipeline for processing. One such speculation unit is a branch prediction unit that predicts whether a conditional branch in a program being executed will be “taken” or “not taken” so that instructions in the predicted path can be fetched or prefetched without causing the pipeline to stall. Another type of speculation unit is known as an out-of-order execution unit. The task of the out-of-order execution unit is to reorder the flow of instructions to optimize performance as the instructions are sent down the pipeline and scheduled for execution. The instructions are reordered to allow them to execute as quickly as possible as each input operand becomes ready.
There is an incentive to construct accurate, and presumably complex, branch prediction schemes. There is also an incentive to perform as much speculative execution as possible in order to avoid pipeline stalls and improve computer performance. However, any execution of instructions by the processor consumes power. While speculative execution that turns out to be incorrect may not waste significant computing time, the energy expended in the computation is wasted because the results of the speculatively-executed instructions are discarded.
While the performance enhancement offered by speculative execution is desirable in nearly any computer, the additional power consumption it entails is a drawback. For example, when running a portable computer on battery power, it may be more important to conserve power than to try to increase computational throughput by speculative execution.